package com.kfm.jdbc.day0404.thread;

public class MyThread extends Thread{

    private String name;

    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        System.out.println("线程的任务");
        // 休眠
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        // 执行线程的任务
        for (int i = 0; i < 10; i++) {
            // Thread.currentThread() 获取当前线程
            System.out.println(Thread.currentThread().getName() + i);
        }


    }
}
